function[c]=Boundary(M,rhs,n,c_0,h,q,Q)

%----------------------------------------  
  %% unten Dirichlet=0
%----------------------------------------  
   ff=1:n;
   M(ff,:)=0;
   rhs(ff)=0;
   for f=1:n       
        
        M(f,f)=1;
        
   end
%   
 
%----------------------------------------  
%     %% oben Dirichlet=0
%----------------------------------------  
    ff=(n^2-(n-1)):n^2;
    M(ff,:)=0;
    rhs(ff)=0;
    for f=(n^2-(n-1)):n^2       
         
         M(f,f)=1;
         
    end
%     
    
 

%
%----------------------------------------  
%%   links Dirichlet 
%----------------------------------------  
    l=(n+1 : n :(n^2)-n);
    M(l,:)=0;
    rhs(l)=c_0;
    for f=1:length(l)
        j=l(f);
        M(j,j)= 1;
     
    end
% rechts Robin
    k=(2*n:n:(n^2)-n);
    M(k,:)=0;
    rhs(k)=Q;
    for m=1:length(l)
        j=k(m);
        M(j,j)=(1/h)*(3/2)-q;
        M(j,j-1)=(1/h)*(-2);
        M(j,j-2)=(1/h)*(1/2);
        
    end
    

%---------------------------------------- 
    %----------------------------------------  
%----------------------------------------  
    %% Solving System
    
    c = M\rhs;
 
    c(c<0)=0;
